<template>
  <div>
    <el-dialog v-model="visible" width="320px" title="订单总金额">
      <el-form ref="formRef" :model="formData">
        <el-form-item label="" prop="请输入订单总金额">
          <el-input v-model="formData.orderAmount" placeholder="请设置订单总金额"/>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button>取消</el-button>
          <el-button type="primary" @click="confirmHandle">保存</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script lang="ts" setup>

import { ref, defineEmits} from 'vue';

const visible = ref(false);
const formRef = ref();
const formData = ref({});

import {setOrderTotalPay} from "../payApi"

const emit = defineEmits(['saveOk']);
const confirmHandle = async function (){
  await setOrderTotalPay(formData.value)
  visible.value = false
  emit('saveOk')
}

defineExpose({
  open: (rowData) => {
    visible.value = true
    formData.value = rowData
  }
})
</script>

<style lang="scss" scoped>

</style>
